#include "../board/sdk_project_config.h"
#include "../board/peripherals_adc_1_config.h"
#include "adc_driver.h"
#include "osal.h"
#include <stdio.h>
#include <string.h>
#include "arduino.h"

#define INST_UART_SAMPLE INST_UART_2
    const char *str = "Hello world\r\n";



int main(void)
{
  status_t status = CLOCK_SYS_Init(g_pstClockManConfigsArr[0]);
  if (status != STATUS_SUCCESS) {
    trace("CLOCK_SYS_Init failed\n");
    while(1);
  }
  
  PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_stPinmuxConfigArr);


  // Initialize UARTs
  status = UART_DRV_Init(INST_UART_SAMPLE, &g_stUartState_2, &g_stUart2UserConfig0);
  if (status != STATUS_SUCCESS) {
    trace("UART2 init failed\n");
  }

  status = UART_DRV_Init(INST_UART_1, &g_stUartState_1, &g_stUart1UserConfig0);
  if (status != STATUS_SUCCESS) {
    trace("UART1 init failed\n");
  }
  status = UART_DRV_Init(INST_UART_4, &g_stUartState_4, &g_stUart4UserConfig0);
  if (status != STATUS_SUCCESS) {
    trace("UART1 init failed\n");
  }

  setLogPort(4);

  while(1) {



    Arduino_Dht11_Example();
    OS_DelayMs(1000);
  }
}
